// SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
// SPDX-License-Identifier: Apache-2.0

package roadmap_dao

import "go.mongodb.org/mongo-driver/v2/mongo"

var RoadmapInfoDao *_RoadmapInfoDao
var RoadmapMemberDao *_RoadmapMemberDao
var ApplyInfoDao *_ApplyInfoDao
var NodeInfoDao *_NodeInfoDao
var EdgeInfoDao *_EdgeInfoDao
var NodeStateInfoDao *_NodeStateInfoDao
var InviteInfoDao *_InviteInfoDao
var ThreadInfoDao *_ThreadInfoDao
var ThreadContentDao *_ThreadContentDao
var RagConfigDao *_RagConfigDao
var ChatMessageDao *_ChatMessageDao
var PlanInfoDao *_PlanInfoDao
var PlanItemInfoDao *_PlanItemInfoDao

func InitDao(mgoDb *mongo.Database) (err error) {
	RoadmapInfoDao, err = newRoadmapInfoDao(mgoDb)
	if err != nil {
		return
	}
	RoadmapMemberDao, err = newRoadmapMemberDao(mgoDb)
	if err != nil {
		return
	}
	ApplyInfoDao, err = newApplyInfoDao(mgoDb)
	if err != nil {
		return
	}
	NodeInfoDao, err = newNodeInfoDao(mgoDb)
	if err != nil {
		return
	}
	EdgeInfoDao, err = newEdgeInfoDao(mgoDb)
	if err != nil {
		return
	}
	NodeStateInfoDao, err = newNodeStateInfoDao(mgoDb)
	if err != nil {
		return
	}
	InviteInfoDao, err = newInviteInfoDao(mgoDb)
	if err != nil {
		return
	}
	ThreadInfoDao, err = newThreadInfoDao(mgoDb)
	if err != nil {
		return
	}
	ThreadContentDao, err = newThreadContentDao(mgoDb)
	if err != nil {
		return
	}
	RagConfigDao, err = newRagConfigDao(mgoDb)
	if err != nil {
		return
	}
	ChatMessageDao, err = newChatMessageDao(mgoDb)
	if err != nil {
		return
	}
	PlanInfoDao, err = newPlanInfoDao(mgoDb)
	if err != nil {
		return
	}
	PlanItemInfoDao, err = newPlanItemInfoDao(mgoDb)
	if err != nil {
		return
	}
	return
}
